package com.yuanqi.Common.config;

import com.yuanqi.Properties.AliProperties;
import com.yuanqi.Utils.AliOssUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliConfig {
    @Bean
    public AliOssUtil aliOssUtil(AliProperties aliProperties) {
        AliOssUtil aliOssUtil = new AliOssUtil(
                aliProperties.getEndpoint(),
                aliProperties.getAccessKeyId(),
                aliProperties.getAccessKeySecret(),
                aliProperties.getBucketName()
        );
        return aliOssUtil;
    }
}
